let app = getApp();
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    disabled:false,
    suffix:'元/吨',
    vModel:"",
    placeholder:'0'
  },
  created() {

  },
  attached: function () {
    var that = this;
    that.setNavSize();
  },
  /**
   * 组件的方法列表
   */
  methods: {
    navTo() {
      let p = getCurrentPages().length;
      if  ( this.data.goback == 'index') {
        app.onLaunch()
        wx.reLaunch({
            url: '/pages/index/index',
        })
      }else if(p <= 1){
        wx.switchTab({
            url: '/pages/index/index',
          })
      } else {
        wx.navigateBack({
          delta: 1,
          success: function (res) {
            wx.setStorageSync('returnFlag', true)
          }
        })
      }
    },

    setNavSize: function () {
      var that = this,
        sysinfo = wx.getSystemInfoSync(),
        statusHeight = sysinfo.statusBarHeight,
        isiOS = sysinfo.system.indexOf('iOS') > -1,
        navHeight;
      if (!isiOS) {
        navHeight = 48;
      } else {
        navHeight = 44;
      }
      that.setData({
        status: statusHeight,
        navHeight: navHeight
      })
    },
    updateDa(e){
      this.setData({
          cardIssuersCode:e.detail.cardIssuersCode
      })
    },
  }
})
